package com.example.yiqinmanagersystem.controller.page;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/*
 **@Author:youpeng
 **Created on 2022/9/14
 */
@Controller
@RequestMapping("/page")
public class PageController {

    @GetMapping("/toLogin")
    public String toLogin(){
        return "login";
    }

    /*
     * 登出
     * */
    @RequestMapping("/logout")
    public String logout(){
        Subject subject = SecurityUtils.getSubject();
        subject.logout();
        return "login";
    }

    @GetMapping("/toMenu")
    public String toMenu(){
        return "menu/menu";
    }

    @GetMapping("/toRole")
    public String toRole(){
        return "role/role";
    }

    @GetMapping("/toUser")
    public String toUser(){
        return "user/user";
    }

    @GetMapping("/toUserInfo")
    public String toUserInfo(){
        return "user/userInfo";
    }

    @GetMapping("/toChangePassword")
    public String toChangePassword(){
        return "user/changepassword";
    }

    @GetMapping("/toNews")
    public String toNews(){
        return "news/news";
    }

    @GetMapping("/toXueYuan")
    public String toXueYuan(){
        return "xueyuan/xueyuan";
    }

    @GetMapping("/toBanJi")
    public String toBanJi(){
        return "banji/banji";
    }

    @GetMapping("/toHeSuan")
    public String toHeSuan(){
        return "hesuan/hesuan";
    }

    @GetMapping("/toVaccine")
    public String toVaccine(){
        return "vaccine/vaccine";
    }
}
